# -*- coding:utf8 -*- #
# -----------------------------------------------------------------------------------
# ProjectName:  smalleel-panel-iot-test
# FileName:     testDemo.py
# Author  :
# Datetime:     2023/6/2 17:57
# Description：
# -----------------------------------------------------------------------------------
from common.util.configUtil.configUtil import ConfigUtil
from common.util.requestsUtil.requestsUtil import RequestsUtil
from common.util.timeUtil.timeUtil import get_timestamp

req = RequestsUtil()

conf = ConfigUtil()


def control():
    timestamp = get_timestamp()
    deviceNo = conf.get_mqtt_config("deviceName")
    # url = "https://test.cloudapi.smalleel.com/platform-aircondition-data-stream/device/setControlCommandToPanelAsyncTest"
    url = "https://test.cloudapi.smalleel.com/platform-aircondition-data-stream/device/setControlCommandToPanelSyncTest"
    params = {"deviceNo": deviceNo, "ControlData.operateValue": "0", "ControlData.action": "setSwitch", "timestamp": timestamp}
    res = req.send_request("get", url=url, params=params)
    print(res)


if __name__ == '__main__':
    control()
